package com.zhihui.online.controller;


import com.zhihui.online.entity.Answer;
import com.zhihui.online.entity.Teacher;
import com.zhihui.online.service.AnswerService;
import com.zhihui.online.utils.MD5Helper;
import com.zhihui.online.utils.Result;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 答案表 前端控制器
 * </p>
 *
 * @author 程序员阿良,21岁纯情后爸,懒得想名字
 * @since 2024-08-01
 */

@RestController
@RequestMapping("/online/answer")
public class AnswerController {

    @Autowired
    private AnswerService answerService;

    @ApiOperation("添加答案")
    @PostMapping("/addAnswer")
    public Result addUser(@RequestBody Answer answer){

        boolean b = this.answerService.save(answer);

        return b?Result.ok():Result.fail();
    }



}

